package java4s;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.validator.annotations.EmailValidator;
import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
 
public class LoginAction extends ActionSupport {
    /**
	 * 
	 */
	private String email;
    private String password;
 
    
     
    @RequiredStringValidator(message = "Please enter your e-mail address.")
    @EmailValidator(message = "Please enter a valid e-mail address.")
    public void setEmail(String email) {
        this.email = email;
    }
     
    @RequiredStringValidator(message = "Please enter your password.")
    public void setPassword(String password) {
        this.password = password;
    }
     
    public String getEmail() {
        return email;
    }
     
    public String getPassword() {
        return password;
    }
	private static final long serialVersionUID = 1L;
	public String execute() {
       if(email.equals("swarup@gmail.com")) {
            return SUCCESS;        
        } else {
            return INPUT;
        }
    }
}